enum goTo {
  top,
  bottom,
  left,
  right,
}
console.log(goTo[0]);
console.log(goTo['top']);

enum Season {
  spring,
  summer,
  autumn,
  winter,
}
console.log(Season[0]);

function callSeason(year: number, msg: string): string {
  return `${year}年,${msg}`;
}

function queryYear() {
  let date = new Date();
  let year = date.getFullYear();
  return year;
}

let cc = queryYear();
let aa = callSeason(cc, Season[0]);
// let bb = callSeason(cc, Season.autumn);// 当msg接收Season类型时,投入子类型时允许的
console.log(cc);
console.log(aa);
// console.log(bb);
